package com.sojson.project.dao.impl;

import java.sql.SQLException;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;

import com.sojson.base.impl.BaseDaoImpl;
import com.sojson.project.dao.TransferRecordDao;
import com.sojson.project.entity.po.TransferRecord;

/**
 * Dao实现类(目的:把分页插件从Service层分离,这样就不用每次调Dao接口都要分页)
 * 
 * @author liu
 * @date 2021-04-23
 */
@Repository
public class TransferRecordDaoImpl extends BaseDaoImpl<TransferRecordDao, TransferRecord> implements TransferRecordDao {

    @Resource
    private TransferRecordDao transferRecordDao;

    /**
     * 单条插入
     * 
     * @param transferRecord
     * @return
     * @throws SQLException 
     */
    @Override
    public int insert(TransferRecord transferRecord) {
        return transferRecordDao.insert(transferRecord);
    }

    /**
     * 批量插入
     * 
     * @param transferRecord
     * @return
     * @throws SQLException 
     */
    @Override
    public int insertList(List<TransferRecord> transferRecords) {
        return transferRecordDao.insertList(transferRecords);
    }

    /**
     * 通过对象批量删除(物理删除)
     * 
     * @param transferRecord
     * @return
     * @throws SQLException 
     */
    @Override
    public int deleteByDto(TransferRecord transferRecord) {
        return transferRecordDao.deleteByDto(transferRecord);
    }

    /**
     * 统计全部数量
     * 
     * @return
     * @throws SQLException 
     */
    @Override
    public int countAll() {
        return transferRecordDao.countAll();
    }

    /**
     * 查询所有
     * 
     * @return
     * @throws SQLException 
     */
    @Override
    public List<TransferRecord> listAll() {
        return transferRecordDao.listAll();
    }

    /**
     * 根据对象统计数量
     * 
     * @param transferRecord
     * @return
     * @throws SQLException 
     */
    @Override
    public int countByDto(TransferRecord transferRecord) {
        return transferRecordDao.countByDto(transferRecord);
    }

    /**
     * 根据对象查询
     * 
     * @param transferRecord
     * @return
     * @throws SQLException 
     */
    @Override
    public List<TransferRecord> listByDto(TransferRecord transferRecord) {
        startPageDefaultSort(transferRecord);
        return transferRecordDao.listByDto(transferRecord);
    }

    /**
     * 通过id删除(物理删除)
     * 
     * @param id
     * @return
     */
    @Override
    public int deleteById(Integer id) {
        return transferRecordDao.deleteById(id);
    }

    /**
     * 通过id列表删除(物理删除)
     * 
     * @param ids
     * @return
     */
    @Override
    public int deleteByIdList(List<Integer> ids) {
        return transferRecordDao.deleteByIdList(ids);
    }

    /**
     * 通过id更新(全部更新)
     * 
     * @param transferRecord
     * @return
     */
    @Override
    public int updateById(TransferRecord transferRecord) {
        return transferRecordDao.updateById(transferRecord);
    }

    /**
     * 通过id列表更新(全部更新)(更新内容相同)
     * 
     * @param transferRecord
     * @return
     */
    @Override
    public int updateStaticByIdList(TransferRecord transferRecord) {
        return transferRecordDao.updateStaticByIdList(transferRecord);
    }

    /**
     * 通过id列表更新(全部更新)(更新内容不相同)
     * 
     * @param transferRecords
     * @return
     */
    @Override
    public int updateChangeByIdList(List<TransferRecord> transferRecords) {
        return transferRecordDao.updateChangeByIdList(transferRecords);
    }

    /**
     * 通过id更新(局部更新)
     * 
     * @param transferRecord
     * @return
     */
    @Override
    public int updatePartialById(TransferRecord transferRecord) {
        return transferRecordDao.updatePartialById(transferRecord);
    }

    /**
     * 通过id列表更新(局部更新)(更新内容相同)
     * 
     * @param transferRecord
     * @return
     */
    @Override
    public int updateStaticPartialByIdList(TransferRecord transferRecord) {
        return transferRecordDao.updateStaticPartialByIdList(transferRecord);
    }

    /**
     * 通过id列表更新(局部更新)(更新内容不相同)
     * 
     * @param transferRecords
     * @return
     */
    @Override
    public int updateChangePartialByIdList(List<TransferRecord> transferRecords) {
        return transferRecordDao.updateChangePartialByIdList(transferRecords);
    }

    /**
     * 通过id查询
     * 
     * @param id
     * @return
     */
    @Override
    public TransferRecord findById(Integer id) {
        return transferRecordDao.findById(id);
    }

    /**
     * 通过id列表查询
     * 
     * @param ids
     * @return
     */
    @Override
    public List<TransferRecord> findByIdList(List<Integer> ids) {
        return transferRecordDao.findByIdList(ids);
    }

    /**
     * 通过对象查询id列表
     * 
     * @param transferRecord
     * @return
     */
    @Override
    public List<Integer> findIdByDto(TransferRecord transferRecord) {
        startPage(transferRecord);
        return transferRecordDao.findIdByDto(transferRecord);
    }

    /**
     * 通过orderNo删除(物理删除)
     * 
     * @param orderNo
     * @return
     */
    @Override
    public int deleteByOrderNo(String orderNo) {
        return transferRecordDao.deleteByOrderNo(orderNo);
    }

    /**
     * 通过orderNo列表删除(物理删除)
     * 
     * @param orderNos
     * @return
     */
    @Override
    public int deleteByOrderNoList(List<String> orderNos) {
        return transferRecordDao.deleteByOrderNoList(orderNos);
    }

    /**
     * 通过orderNo更新(全部更新)
     * 
     * @param transferRecord
     * @return
     */
    @Override
    public int updateByOrderNo(TransferRecord transferRecord) {
        return transferRecordDao.updateByOrderNo(transferRecord);
    }

    /**
     * 通过orderNo列表更新(全部更新)(更新内容相同)
     * 
     * @param transferRecord
     * @return
     */
    @Override
    public int updateStaticByOrderNoList(TransferRecord transferRecord) {
        return transferRecordDao.updateStaticByOrderNoList(transferRecord);
    }

    /**
     * 通过orderNo列表更新(全部更新)(更新内容不相同)
     * 
     * @param transferRecords
     * @return
     */
    @Override
    public int updateChangeByOrderNoList(List<TransferRecord> transferRecords) {
        return transferRecordDao.updateChangeByOrderNoList(transferRecords);
    }

    /**
     * 通过orderNo更新(局部更新)
     * 
     * @param transferRecord
     * @return
     */
    @Override
    public int updatePartialByOrderNo(TransferRecord transferRecord) {
        return transferRecordDao.updatePartialByOrderNo(transferRecord);
    }

    /**
     * 通过orderNo列表更新(局部更新)(更新内容相同)
     * 
     * @param transferRecord
     * @return
     */
    @Override
    public int updateStaticPartialByOrderNoList(TransferRecord transferRecord) {
        return transferRecordDao.updateStaticPartialByOrderNoList(transferRecord);
    }

    /**
     * 通过orderNo列表更新(局部更新)(更新内容不相同)
     * 
     * @param transferRecords
     * @return
     */
    @Override
    public int updateChangePartialByOrderNoList(List<TransferRecord> transferRecords) {
        return transferRecordDao.updateChangePartialByOrderNoList(transferRecords);
    }

    /**
     * 通过orderNo查询
     * 
     * @param orderNo
     * @return
     */
    @Override
    public TransferRecord findByOrderNo(String orderNo) {
        return transferRecordDao.findByOrderNo(orderNo);
    }

    /**
     * 通过orderNo列表查询
     * 
     * @param orderNos
     * @return
     */
    @Override
    public List<TransferRecord> findByOrderNoList(List<String> orderNos) {
        return transferRecordDao.findByOrderNoList(orderNos);
    }

    /**
     * 通过对象查询orderNo列表
     * 
     * @param transferRecord
     * @return
     */
    @Override
    public List<String> findOrderNoByDto(TransferRecord transferRecord) {
        startPage(transferRecord);
        return transferRecordDao.findOrderNoByDto(transferRecord);
    }

    /**
     * 通过对象删除(逻辑删除)
     * 
     * @param transferRecord
     * @return
     */
    @Override
    public int deleteByDtoAndUpdate(TransferRecord transferRecord) {
        return transferRecordDao.deleteByDtoAndUpdate(transferRecord);
    }

    /**
     * 统计所有未删除的数据
     * 
     * @return
     */
    @Override
    public int countAllAndStatusNo() {
        return transferRecordDao.countAllAndStatusNo();
    }

    /**
     * 查询所有未删除的数据
     * 
     * @return
     */
    @Override
    public List<TransferRecord> findAllAndStatusNo() {
        return transferRecordDao.findAllAndStatusNo();
    }

    /**
     * 通过id删除(逻辑删除)
     * 
     * @param id
     * @return
     */
    @Override
    public int deleteByIdAndUpdate(Integer id) {
        return transferRecordDao.deleteByIdAndUpdate(id);
    }

    /**
     * 通过id列表删除(逻辑删除)
     * 
     * @param ids
     * @return
     */
    @Override
    public int deleteByIdListAndUpdate(List<Integer> ids) {
        return transferRecordDao.deleteByIdListAndUpdate(ids);
    }

    /**
     * 通过orderNo删除(逻辑删除)
     * 
     * @param orderNo
     * @return
     */
    @Override
    public int deleteByOrderNoAndUpdate(String orderNo) {
        return transferRecordDao.deleteByOrderNoAndUpdate(orderNo);
    }

    /**
     * 通过orderNo列表删除(逻辑删除)
     * 
     * @param orderNos
     * @return
     */
    @Override
    public int deleteByOrderNoListAndUpdate(List<String> orderNos) {
        return transferRecordDao.deleteByOrderNoListAndUpdate(orderNos);
    }

    /**
     * 清空数据(物理清空)
     */
    @Override
    public void clear() {
        transferRecordDao.clear();
    }

    /**
     * 清空数据(逻辑清空)
     */
    @Override
    public void clearAndUpdate() {
        transferRecordDao.clearAndUpdate();
    }

}